- /* sifdivkn.cpp by K.Tsuru */
- // function ID = 425, 426 BRADIX
- /**********************************************
- SInteger class
- It provides the quotient m/n and remainder m%n.
- The Knuth's method division is used
- ***********************************************/
- #ifndef SN_H
- #include "sn.h"
- #endif
- // function ID = 425
- //If the remainder is not necessary set rem = 0.
- void IIDiv(const SInteger& m, const SInteger& n, Ldiv_t& r, int rem){
- KnuthIIDiv(m, n, r, rem);
- }
-
- // function ID = 426
- void KnuthIIDiv(const SInteger& m, const SInteger& n, Ldiv_t& r, int rem){
- int dm = SLong::LLDivMode(); //It keeps the value of "llDivMode".
- SLong::UseKnuthLLDiv(); //It indicates to use "KnuthLLDiv()".
- /*
- It does not directly call the "KnuthLLdiv()", bacause the pre- and post-processing
- are included in the "LLDiv()".
- */
- r = LLDiv(m, n, rem);
- //It restores llDivMode. When "NewtonLLDiv()" is not used, it is not linked.
- SInteger tmp;
- tmp.SetLLDivMode(dm);
-
- // r.quot.LLDivMode(dm);
- }
sifdivkn.cpp : last modifiled at 2010/05/16 13:43:18(1,013 bytes)
created at 2016/04/25 14:53:17
The creation time of this html file is 2017/10/25 11:09:45 (Wed Oct 25 11:09:45 2017).